package org.fglxy.mockserver.exception;

import org.fglxy.mockserver.enums.RetCodeEnum;

@SuppressWarnings("serial")
public class MessageException extends RuntimeException {
	private RetCodeEnum code;
	private String message;
	
	public MessageException(RetCodeEnum code) {
		super();
		this.code = code;
		this.message = code.getDesc();
	}
	
	public MessageException(RetCodeEnum code, Throwable cause) {
		super(cause);
		this.code = code;
		this.message = code.getDesc();
	}
	
	public MessageException(RetCodeEnum code, String message) {
		super();
		this.code = code;
		this.message = message;
	}
	
	public MessageException(RetCodeEnum code, String message, Throwable cause) {
		super(cause);
		this.code = code;
		this.message = message;
	}

	public RetCodeEnum getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}
	
	
}
